package net.zdreamer.geracomium.utils.tools_utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class ConnectityUtils {
	private static ConnectivityManager manager;

	public ConnectityUtils() {
	}

	/**
	 * 判断手机网络的工具类
	 * @param context
	 * @return
	 */
	
	public static boolean isNetConnected(Context context) {
		boolean flag = false;
		manager = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		//2g  3g 信号
		NetworkInfo mobile=manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
		NetworkInfo wifi=manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
		
		if(mobile.isConnected()||wifi.isConnected()){
			flag=true;
		}
		return flag;
	}
}
